﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>发布中心</title>
</head>
<body>

    <button id="pubBtn">
        发布
    </button>
    <script type="text/javascript">
        const connection = new signalR.HubConnectionBuilder()
            .withUrl("/hub/Publisher")
            .configureLogging(signalR.LogLevel.Information)
            .build();

        async function start() {
            try {
                await connection.start();
                console.log("SignalR Connected.");
            } catch (err) {
                console.log(err);
                setTimeout(start, 5000);
            }
        };

        connection.onclose(async () => {
            await start();
        });

        // Start the connection.
        start();
    </script>
    <script src="js/signalR.js"></script>
</body>
</html>